{extend name="base" /}
{block name="body"}
<div class="layui-card">
  <div class="layui-card-body">
    <blockquote class="layui-elem-quote layui-text">
        广告：<span class="text-danger"></span>广告管理注意事项<span class="text-danger"></span>
    </blockquote>
    <div class="layui-form-item">
        <form class="layui-form layui-form-pane" action="{:request()->url()}" >
            <div class="layui-input-inline">
                <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="{if $Request.get.title}{$Request.get.title}{else}请输入关键字{/if}" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">{$Think.lang.search}</button>
                <button type="reset" class="layui-btn layui-btn-primary">{$Think.lang.reset}</button>
            </div>
        </form>
        <button class="layui-btn layui-btn-normal open-popup" data-title="{$Think.lang.add}" data-url="{:url('add')}"><i class="fa fa-plus"></i>{$Think.lang.add}</button>
        <button class="layui-btn layui-btn-{empty name='list'}primary{else}normal open-popup{/empty}" data-title="广告分类" data-url="{:url('adcat/lists')}"><i class="fa fa-database"></i>广告分类</button>
    </div>
        <table class="layui-table layui-form" lay-skin="line">
            <thead>
                <tr>
                    <th>{$Think.lang.id}</th>
                    <th>{$Think.lang.name}</th>
                    <th>{$Think.lang.img}</th>
                    <th>{$Think.lang.url}</th>
                    <th>APP{$Think.lang.url}</th>
                    <th>{$Think.lang.cat}</th>
                    <th>{$Think.lang.CreateTime}</th>
                    <th>{$Think.lang.Status}</th>
                    <th>{$Think.lang.Handle}</th>
                </tr>
            </thead>
            <tbody>
                {volist name="list" id="v" empty="$empty"}
                <tr>
                    <td>{$i}</td>
                    <td>{$v.name}</td>
                    <td><img src="{$v.img}" alt=""></td>
                    <td>{$v.url}</td>
                    <td>{$v.app_url}</td>
                    <td>{$v.cat_name}</td>
                    <td>{$v.create_time}</td>
                    <td><input type="checkbox" name="status" value="{$v.id}" lay-skin="switch" lay-filter="*" lay-text="开启|禁用" data-url="{:url('edit')}" {if $v.status eq 1}checked{/if}></td>
                    <td>
                    	<button class="layui-btn layui-btn-xs open-popup" data-title="{$Think.lang.edit}" data-url="{:url('edit', ['id' => $v.id])}"><i class="fa fa-edit"></i>{$Think.lang.edit}</button>
                        <button class="layui-btn layui-btn-danger ajax-del layui-btn-xs" data-title="{$Think.lang.drop}" data-url="{:url('del', ['id' => $v.id])}"><i class="fa fa-trash-o"></i>{$Think.lang.drop}</button>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>
        <div class="page">{$list|raw}</div>
    </div>
</div>
{/block}
{block name="js"}
{/block}